package com.example.mycrimelntent;

import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;

import android.os.Bundle;

import com.example.mycrimelntent.databinding.FragmentCrimeBinding;


public class MainActivity extends AppCompatActivity {
    private FragmentCrimeBinding binding;
    final FragmentManager manager = getSupportFragmentManager();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding=FragmentCrimeBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
        //加载crimefragment
        Fragment blankFragment = new CrimeFragment();
        manager.beginTransaction()
                .add(R.id.fragment_container_crime,blankFragment)
                .addToBackStack(null)
                .commit();
    }
}